<template>
	<u-mask :show="shareModel" @click="closeMask">
		<u-image width="90%" height="1300rpx" class="poster" :src="shareImg" mode="widthFix" border-radius="20"
			:lazy-load="true"></u-image>
		<div class="bottom">
			<!-- #ifndef H5 -->
			<!-- <button class="item" open-type="share" @click="goShareApp('weixin','WXSceneSession',2)">
				<u-image class="icon" src="/static/images/share/icon-wechat.png" width="70" height="70"></u-image>
				<p class="name">微信好友</p>
			</button>
			<div class="item" @click="goShareApp('weixin','WXSenceTimeline',2)">
				<u-image class="icon" src="/static/images/share/icon-timeLine.png" width="70" height="70"></u-image>
				<p class="name">朋友圈</p>
			</div> -->
			<div class="item" >
				<u-image class="icon" src="/static/images/share/icon-download.png" width="70" height="70"></u-image>
				<p class="name">长按海报保存图片</p>
			</div>
	<!-- 		<div class="item" @click="copyShareLink">
				<u-image class="icon" src="/static/images/share/icon-copyLink.png" width="70" height="70"></u-image>
				<p class="name">复制链接</p>
			</div> -->
			<!-- #endif -->
			<!-- #ifdef H5 -->
			<div class="item">
				<u-image class="icon" src="/static/images/share/icon-download.png" width="70" height="70"></u-image>
				<p class="name">长按海报保存图片</p>
			</div>
			<!-- #endif -->
			<!-- #ifdef APP-PLUS -->
			<div class="item" @click="otherShare">
				<u-image class="icon" src="/static/images/share/icon-otherShare.png" width="70" height="70"></u-image>
				<p class="name">系统分享</p>
			</div>
			<!-- #endif -->
		</div>

	</u-mask>
</template>

<script>
	import shareJS from "@/utils/share.js"

	export default {
		name: "shareMask",
		mixins: [shareJS],
		data() {
			return {
				shareModel: false,
			}
		},

		onLoad() {
			uni.showShareMenu({
				title: 'WoShop商城',
				content: '好物分享',
				path: '/pages/tabBar/home'
			})
		},
		methods: {
			closeMask() {
				this.shareModel = false
				this.$emit('onCloseMask')
			}
		}

	}
</script>

<style lang="scss" scoped>
	.poster {
		margin: 150rpx auto 0;
		transform: scale(0.9);
		display: block;
		border-radius: 20rpx;
	}

	.bottom {
		position: fixed;
		display: flex;
		justify-content: space-around;
		align-items: center;

		bottom: 40rpx;
		/*  #ifdef H5 */
		bottom: 110rpx;
		/*  #endif  */
		width: 90%;
		margin: 0 auto;
		left: 0;
		right: 0;

		.item {
			display: flex;
			flex-direction: column;
			justify-content: center;
			background-color: transparent;
			padding: 0;
			margin: 0;
			text-align: center;

			.icon {
				margin: 0 auto;
			}

			.name {
				color: #fff;
				font-size: 28rpx;
				color: #f5f5f5;
				margin-top: 10rpx;
				line-height: 1.4;
			}
		}
	}
</style>
